<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="/common/jsp/taglibs-nojs-nocss.jsp"%>
<%@ page isELIgnored="false" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<div id="pop_up_content">
	<div class="pop_up_title images_13">
		<s:if test="null==form.id || ''.equal(form.id)">
			新建供应商
		</s:if>
		<s:else>
			编辑供应商
		</s:else>
	</div>
	<div class="pop_up_body">
		<form id="saleChanceEdit" action="supplierAction!editSupplier.action" >
			<input type="hidden" value="<s:property value='form.id'/>" name="form.id"/>
			<table border="0" cellpadding="0" cellspacing="0" width="450px">
				
				<tr id="isEquip" style="height:22px;">
					<td class="form_input_value">
							<span class="red">*</span>类别
					</td>
					<td  colspan="3">
						<select name="form.supplierType" class="dialogy_select" style="width: 260px">
							<s:iterator value="map.keySet()" id="key" status="stat" >
								<s:if test="#key==form.supplierType">
									<option value='<s:property value="#key"/>' selected="selected" class="dialogy_input"><s:property value="map.get(#key)"/></option>
								</s:if>
								<s:else>
									<option value='<s:property value="#key"/>' class="dialogy_input"><s:property value="map.get(#key)"/></option>
								</s:else>
							</s:iterator>
						</select>
					</td>
				</tr>
				
				<tr style="height:22px;">
					<td class="form_input_value" >
						<span class="red">*</span>厂家名称
					</td>
					<td colspan="3">
					   <input style="width:260" id="form.factoryName" name="form.factoryName" type="text" value="${form.factoryName}" class="required validate_forbiddenChar max_length:40" />
					</td>
				</tr>
				
				<tr style="height:22px;">
					<td class="form_input_value">
							<span class="red">*</span>主要产品
					</td>
					<td  colspan="3">
						<input style="width:260" id="form.mainProduct" name="form.mainProduct" type="text" value="${form.mainProduct}" class="required validate_forbiddenChar max_length:40" />
					</td>
				</tr>
				<tr style="height:22px;">
					<td class="form_input_value">
							<span class="red">*</span>地址
					</td>
					<td  colspan="3">
						<input style="width:260" id="form.address" name="form.address" type="text" value="${form.address}" class="required validate_forbiddenChar max_length:40" />
					</td>
				</tr>
				
				<tr style="height:22px;">
					<td class="form_input_value">
							<span class="red">*</span>联系人
					</td>
					<td  colspan="3">
						<input style="width:260" id="form.linkMan" name="form.linkMan" type="text" value="${form.linkMan}" class="required validate_forbiddenChar max_length:40" />
					</td>
				</tr>
				<tr style="height:22px;">
					<td class="form_input_value">
							<span class="red">*</span>电话
					</td>
					<td  colspan="3">
						<input style="width:260" id="form.telePhone" name="form.telePhone" type="text" value="${form.telePhone}" class="required validate_forbiddenChar max_length:40" />
					</td>
				</tr>
				<tr style="height:22px;">
					<td class="form_input_value">
							<span class="red">*</span>手机
					</td>
					<td  colspan="3">
						<input style="width:260" id="form.phone" name="form.phone"  value="${form.phone}"  type="text" class="required validate_forbiddenChar max_length:40" />
					</td>
				</tr>
				<tr style="height:22px;">
					<td class="form_input_value">
							<span class="red"></span>传真
					</td>
					<td  colspan="3">
						<input style="width:260" id="form.fax" name="form.fax" type="text" value="${form.fax}" />
					</td>
				</tr>
				<tr style="height:22px;">
					<td class="form_input_value">
							<span class="red"></span>邮箱
					</td>
					<td  colspan="3">
						<input style="width:260" id="form.email" name="form.email"  value="${form.email}"  type="text" />
					</td>
				</tr>
				
				<tr style="height:22px;">
					<td></td>
					<td colspan="3">
						<input id="saleChanceEditSubmit" type="button" value="确定" class="btn" onmouseout="this.className='btn'" onmousedown="this.className='btn1'" onmouseover="this.className='btn2'">
						<input type="button" value="取消" class="btn" onclick="hideDialog()" onmouseout="this.className='btn'" onmousedown="this.className='btn1'" onmouseover="this.className='btn2'">
					</td>
				</tr>
			</table>
		</form>
	</div>
</div>
<script>
	
	/* 表单提交 */
	i.formSubmit("saleChanceEditSubmit",	//绑定的按钮id
					  "saleChanceEdit" ,   //提交的表单id
					  function(result){
						  	var jsonMsgObj=new JsonMsgObj(result);
							var  msg=jsonMsgObj.getMessage();
						    var codeId=jsonMsgObj.getCodeid();
							var isOk=jsonMsgObj.getIsok();
							if( isOk ){
							    aerouiAlert(msg);
								hideDialog();// 隐藏窗口
								window.location.reload();
							}else{		// 如果编辑失败了
							  JsManageInfoHandleException( result , function(msg , codeId , isOk){
							  		hideDialog();// 隐藏窗口
							   });
						   }
						});
</script>